FROM node:22.11-bookworm

WORKDIR /app
COPY . .
RUN npm ci --only=production

# 修复源：替换 debian.sources 文件
RUN sed -i 's|deb.debian.org|deb.debian.org.cloudflare-dns.com|g' /etc/apt/sources.list.d/debian.sources && \
    sed -i 's|security.debian.org|deb.debian.org.cloudflare-dns.com|g' /etc/apt/sources.list.d/debian.sources

# 安装 Docker CLI
RUN apt update && \
    apt install -y ca-certificates curl gnupg && \
    install -m 0755 -d /etc/apt/keyrings && \
    apt update && apt install -y docker-ce-cli && \
    rm -rf /var/lib/apt/lists/*

CMD ["node","test.js"]
